package com.my.hzb.user.service;

import java.util.*;

import com.my.hzb.common.bean.GlobalBean;
import com.my.hzb.common.bean.ResultBean;
import com.my.hzb.common.util.HttpUtil;

public class UserHttpServiceImpl {

	private String orderUrl = GlobalBean.Url.order;//"http://localhost:8086/hzb_order/";
	public int countOrder(){
		Map<String,String> keyValueMap = new HashMap<String,String>();
		ResultBean resultBean = HttpUtil.getResultByHttp(orderUrl+"order/count", keyValueMap);
		if(null!=resultBean&&"0000".equals(resultBean.getRespCode())){
			if(null!=resultBean.getReturnStr()&&!"".equals(resultBean.getReturnStr())){
				return Integer.parseInt(resultBean.getReturnStr());
			}
		}
		return 0;
	}
	public Double countOrderPrice(){
		Map<String,String> keyValueMap = new HashMap<String,String>();
		ResultBean resultBean = HttpUtil.getResultByHttp(orderUrl+"order/countPrice", keyValueMap);
		if(null!=resultBean&&"0000".equals(resultBean.getRespCode())){
			if(null!=resultBean.getReturnStr()&&!"".equals(resultBean.getReturnStr())){
				return Double.parseDouble(resultBean.getReturnStr());
			}
		}
		return 0D;
	}
}
